﻿using System;
using NServiceBus;


namespace Client
{
    public class MyClient
    {
    	private readonly IBus c_bus;


    	public MyClient(IBus bus)
    	{
    		this.c_bus = bus;
    	}


        public void Run()
        {
            Console.WriteLine("Press 'Enter' to send a message.To exit, Ctrl + C");

            while (Console.ReadLine() != null)
            {
				var _trackingIdentifier = Guid.NewGuid();

				this.c_bus.Send<CCSMessage.IAuthorisationExecutionCompleted>(m => { m.TrackingIdentifier = _trackingIdentifier; });
				this.c_bus.Send<CCSMessage.IExceptionalAuthorisationExecutionAttempted>(m => { m.TrackingIdentifier = _trackingIdentifier; });
            }
        }
    }
}

